<template>
  <div>
    <el-row>
      <el-button type="info" class="el-icon-arrow-left" @click="goback"
        >返回</el-button
      >
    </el-row>
    <el-form ref="form" :model="all" label-width="80px">
      <el-form-item label="名称">
        <el-input v-model="all.drug_class_name"></el-input>
      </el-form-item>
      <el-form-item label="备注">
        <el-input v-model="all.note"></el-input>
      </el-form-item>
      <el-form-item label="排序">
        <el-input v-model="all.sorting"></el-input>
      </el-form-item>
      <el-form-item>
        <el-checkbox v-model="all.is_look">显示</el-checkbox>
      </el-form-item>
      <hr />
      <el-form-item>
        <el-button type="primary" @click="onSubmit">保存</el-button>
        <el-button>取消</el-button>
      </el-form-item>
    </el-form>
  </div>
</template>
<script>
import { mod } from "../../utils/api/classification";
export default {
  name: "",
  components: {},
  data() {
    return {
      form: {
        drug_class_name: null,
        note: null,
        sorting: null,
        is_look: null,
      },
      all: {},
      checked: true,
    };
  },
  created() {
    this.all = this.$route.query;
    console.log(this.all);
  },
  methods: {
    onSubmit() {
      mod(this.all).then((data) => {
        console.log(data);
      });
      setTimeout(() => {
        this.goback();
      }, 500);
    },
    goback() {
      this.$router.push("/home/classification/classification_home");
    },
  },
};
</script>
<style lang="less" scoped>
.el-form-item {
  display: block;
  float: left;
  width: 50%;
  padding-top: 10px;
  box-sizing: border-box;
}
.el-select {
  width: 100%;
}
hr {
  width: 100%;
}
.modbt {
  width: 70px;
  // height: 26px;
  line-height: 10px;
  font-weight: bold;
}
</style>